/*
 * glReflection.h
 *
 *  Created on: 10.11.2012
 *      Author: Martin
 *
 *      reflection of water or another surface
 *      creating texture
 */

#pragma once

#include <GLee.h>

#define NO_SDL_GLEXT

#include "GL/gl.h"
#include "GL/glu.h"
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/transform.hpp>
#include <iostream>
#include "../scene/World.h"
#include "../Water.h"
#include "../engine/engineSettings.h"

class glReflection
{
public:
	glReflection(Water *_water);
	virtual ~glReflection();

	// starting render to texture
	void glReflectionBegin();

	// end of texture render, return texture ID
	GLuint glReflectionEnd();

private:
	Water *water;

	// ID of texture
	GLuint RefTexture;

	// ID of frame buffer and depth buffer
	GLuint FramebufferName, depthrenderbuffer;

	// view matrix buffer
	glm::mat4 ViewBuffer;
};

